package com.ml.mall.model.mail.supplier;

import com.ml.mall.model.MailMessage;
import org.springframework.stereotype.Component;

/**
 * @description 该类为卖家提供邮件模板
 * @author pl
 * @date 2021/7/13
 * @version 1.0
*/
@Component
public class MailTemplateForSupplier {


    /**
     * 合伙人发起注册邀请，系统发送 “合伙人发起注册邀请” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getRegistrationInvitationFromPartner(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Invitation to join Airena Procure");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                You are invited to register as <span style=\"color: #54af9a;\">supplier</span> in Airena Procure System!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi, <strong></strong></p>\n" +
                "        <br>\n" +
                "        <p>You are invited to register as a supplier in Airena Procure by <strong>partner_name</strong>!</p>\n" +
                "        <p>Click the button below to complete your registration.</p>\n" +
                "        <a href=sysRegisterUrl style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">Register</a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }
    /**
     * 系统发送 配套升级的模板给公司
     * @param to 给对应的公司
     * @return
     */
    public MailMessage getSubjectChangeEmail(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Subscription Package has been changed");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Subscription Package has been changed!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>company_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>Subscription Package has been changed to <strong>package_name</strong>!</p>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                        );

        return mailMessage;
    }
    /**
     * 系统发送 “商户成功注册通知” 通用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getRegisterSuccessfulEmail(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Email Verification");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Verify your email now!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>company_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>You have successfully registered as a Supplier in Airena Procure!</p>\n" +
                "        <p>Verify your email now!</p>\n" +
                "        <a href=emailVerificationUrl style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">Verify Email</a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }

    /**
     * “账号被批准” 公司被批准通用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getAccountApproval(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Account has been approved");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Your account has been <span style=\"color: #54af9a;\">Approved</span>!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>company_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>Congratulations!</p>\n" +
                "        <p>Your account has been approved!</p>\n" +
                "        <p>Log in to Airena Procure now and proceed to fill up your company details. Once completed, you may upload your products.</p>\n" +
                "        <a href=system_url style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">Log In Now</a>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }

    /**
    卖家订单邮件创建在：com.ml.mall.utils.MailTemplateUtils.MailSupplierTeplate
     */

    /**
     * 低库存量通知，系统发送 “低库存量通知” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getLowStockNotification(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Product variant is low in stock!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                <span style=\"color: #54af9a;\">product_variant_name</span> is Low In Stock!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>supplier_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>The product <strong>product_variant_name</strong> is currently low in stock. Please replenish now.</p>\n" +
                "        <a href=system_url style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">View Product</a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }

    /**
     * 零库存通知，系统发送 “零库存通知” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getOutOfStockNotification(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Product variant is out of stock!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                <span style=\"color: #54af9a;\">product_variant_name</span> is Out Of Stock now!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>supplier_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>The product <strong>product_variant_name</strong> is currently out of stock. Please replenish now.</p>\n" +
                "        <a href=system_url style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">View Product</a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }

    /**
     * 增加额度通知，系统发送 “增加额度通知” 邮件给卖家
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getCreditNotification(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Your have more credit now!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                You have <span style=\"color: #54af9a;\">More Credit</span> Now!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong> company_name ,</strong></p>\n" +
                "        <br>\n" +
                "        <p>Your credit has been increased to <strong>current_credit</strong>.</p>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "        \n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }


    /**
     * 暂停公司通知，“暂停公司通知”公用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getCompanySuspended(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Company has been suspended!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Your company has been <span style=\"color: #f5537f;\">Suspended</span>!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>user_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>Your company <strong>company_name</strong> has been suspended. Your account will no longer be accessible.</p>\n" +
                "        <br>\n" +
                "        <p>Please contact <strong>contact_no</strong> or send email to <strong>general_email</strong> if you need any rectification.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }

    /**
     * 拒绝公司通知，“拒绝公司通知”公用
     * @param to 收件人邮箱
     * @return
     */
    public MailMessage getCompanyRejected(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Account has been rejected!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Your account has been <span style=\"color: red;\">Rejected</span>!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>user_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>Your account has been rejected due to the reason below:</p>\n" +
                "        <p><strong>refuse_reason</strong></p>\n" +
                "        <br>\n" +
                "        <p>Need help? Please contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }

    /**
     * 拒绝产品邮件模板
     * @param to
     * @return
     */
    public MailMessage getProductRejectedEmail(String to){

        MailMessage mailMessage = new MailMessage();
        //设置模板标题
        mailMessage.setSubject("Product has been rejected!");
        mailMessage.setReceiverEmail(to);
        mailMessage.setContent(
                "<div style=\"width: 1000px; margin: auto; text-align: left;font-family: 'Helvetica', sans-serif;\">\n" +
                "    <img src=mainPicUrl style=\"width: 100%; height: 200px; margin: -8px;\">\n" +
                "    <div style=\"border-bottom: solid 0.5px #e1e6ed; padding-bottom: 50px; width: 90%; margin: auto;\">\n" +
                "        <div style=\"width: 70%;\">\n" +
                "            <span style=\"font-weight: bold; font-size: 32pt; color: #06375b;\">\n" +
                "                Your product has been <span style=\"color: red;\">Rejected</span>!\n" +
                "            </span>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "    <div style=\"width: 90%; margin: auto; padding-top: 20px;\">\n" +
                "        <p>Hi <strong>supplier_name</strong>,</p>\n" +
                "        <br>\n" +
                "        <p>Your product <strong>product_name</strong> has been rejected by admin due to the reason below:</p>\n" +
                "        <p><strong>reject_reason</strong></p>\n" +
                "        <br>\n" +
                "        <p>Please make the necessary changes before re-uploading the product.</p>\n" +
                "        <a href=system_url style=\"background-color: #2C84EA; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; border-radius: 12px;\">View Product</a>\n" +
                "        <br>\n" +
                "        <p>Need help? Contact <strong>contact_no</strong> or send email to <strong>general_email</strong> for enquiry.</p>\n" +
                "        <br>\n" +
                "        <p>Best regards,<br><strong>Airena Procure Team</strong></p>\n" +
                "    </div>\n" +
                "</div>"
                );

        return mailMessage;
    }
}
